package org.example.game.history;

import java.util.Arrays;

/**
 * @Description: TODO
 * @Author wyatt
 * @Data 2024/06/09 10:46
 */
public class Solution100305 {

    public static void main(String[] args) {
//        System.out.println( 10*10*10*10*10*10*10*10*10 + 7);

        Solution100305 solution100305 = new Solution100305();
        System.out.println(solution100305.valueAfterKSeconds(1, 1000));
    }

    public int valueAfterKSeconds(int n, int k) {
        int[][] nums = new int[k+1][n];
        Arrays.fill(nums[0], 1);

        for(int i=1;i<=k;i++){
            nums[i][0] = 1;
            for(int j=1;j<n;j++){
                if(j == 1){
                    nums[i][j] = nums[i-1][j] + 1;
                }else {
                    nums[i][j] = nums[i-1][j] + nums[i][j-1];
                }
                if(nums[i][j] > 1000000007){
                    nums[i][j] = nums[i][j] % 1000000007;
                }
            }
        }

        return nums[k][n-1];
    }

}
